package com.renu.jdependencyanalyser.model;

import java.util.HashSet;
import java.util.Set;

public class JarModel {
    //xmlpull-1.1.3.4d_b4_min.jar
    private String jarSig;
    private String jarPath;
    private Set<String> pcks;

    private String group;
    private String artifact;
    private String version;


    public JarModel(String jarSig, String jarPath) {
        this.jarSig = jarSig;
        this.jarPath = jarPath;
        this.pcks= new HashSet<>();
    }

    public String getJarSig() {
        return jarSig;
    }

    public void setJarSig(String jarSig) {
        this.jarSig = jarSig;
    }

    public String getJarPath() {
        return jarPath;
    }

    public void setJarPath(String jarPath) {
        this.jarPath = jarPath;
    }

    public Set<String> getPcks() {
        return pcks;
    }

    public void setPcks(Set<String> pcks) {
        this.pcks = pcks;
    }

    public void addPck(String pckSig) {
        if (pcks.contains(pckSig)){
            return ;
        }
        pcks.add(pckSig);
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public void setArtifact(String artifact) {
        this.artifact = artifact;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getGroup() {
        return group;
    }

    public String getArtifact() {
        return artifact;
    }

    public String getVersion() {
        return version;
    }

    @Override
    public String toString() {
        return group +":"+ artifact +":" +version;
    }
}
